package com.kay.restdemo.server.controller;

import com.kay.restdemo.server.domain.Student;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class StudentController {
    @RequestMapping(value = "/student")
    public List<Student> printStudent(){
        Student st = new Student();
        List<Student> list = new ArrayList<Student>();
        st.setName("kay");
        st.setAge(20);
        st.setId(1);
        list.add(st);
        Student st2 = new Student();
        st2.setAge(30);
        st2.setName("zhangsan");
        st2.setId(2);
        list.add(st2);
        return list;
    }
}
